<?php
set_time_limit(0);
if (isset($_POST['uid']) && isset($_POST['ph'])){
    include '../c/config.php';
    $openid=trim(addslashes($_POST['uid']));
    $phone=trim(addslashes($_POST['ph']));
    $mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
    $queryJ=$mysqli->query("SELECT id from `uinfo` where uid='".$openid."' and phone='".$phone."'  limit 0,1 ");
    if($queryJ->num_rows>0){
       $hasDa=1;
        $query=$mysqli->query("SELECT id from `t6` where uid='".$openid."' and phone='".$phone."'  limit 0,1 ");
        if($query->num_rows>0){
            $hasDa=2;
        }
        if(1 == $hasDa){
            $query=$mysqli->query("SELECT id from `t9` where uid='".$openid."' and phone='".$phone."'  limit 0,1 ");
            if($query->num_rows>0){
                $hasDa=2;
            }
        }

        
       echo json_encode(array('s'=>'y','h'=>$hasDa));
    }else{
       echo json_encode(array('s'=>'n'));
    }
    	 
    
}else{
    echo json_encode(array('s'=>'n'));
}

?>